<?php
//echo "提交数据错误或已经领奖！";exit;
$s = isset($_GET['s'])?$_GET['s']:'';
$openid = isset($_GET['openid'])?$_GET['openid']:'';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no,width=device-width, initial-scale=1.0 maximum-scale=1.0">
<meta name="Keywords" content="正品验证" />
<meta name="Description" content="正品验证" />
<title>卡玫尔</title>
<link rel="stylesheet" href="Public/css/home.min.css" />
<script src="./Public/js/jquery-1.7.2.min.js"></script>
<script language="javascript" type="text/javascript" src="Public/js/sel.js"   charset="gb2312"></script>
<script type="text/javascript">
	var ua = navigator.userAgent;
	var ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
    isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
    isAndroid = ua.match(/(Android)\s+([\d.]+)/),
    isMobile = isIphone || isAndroid;
    if(isMobile) 
    {
        return true;
    }
    else
    {
        location.href = 'tip.php';
    }
//或者单独判断iphone或android 
//    if(isIphone){
//        //code 
//    else if(isAndroid){
//        //code
//    }else{
//        //code
//    }
</script>
<style type="text/css">
.td{border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;}
.table{border:solid #000; border-width:1px 0px 0px 1px;}
input
{
	BACKGROUND-COLOR: transparent;
	BORDER-BOTTOM: #000 1px solid;
	BORDER-LEFT: #000 1px solid;
	BORDER-RIGHT: #000 1px solid;
	BORDER-TOP: #000 1px solid;
	COLOR: #FFF;
	WIDTH:200px;
	HEIGHT: 28px;
	border-color: #FFD300 #FFD300 #FFD300 #FFD300; font-size: 9pt;
	-moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius:5px;
}
#logo
{
	max-width:100%;
	max-height:100%;
	max-width: 100%;
	height: auto;
	width: auto\9;
}
</style>
</head>
<body class="ui-bar-a" style="background-color:orange;/*background-image:url(../user/images/qyy.png);*/">
<img src="../images/logo.png" style="margin-left:17px; margin-top:9px;" id="logo" width="100px" height="55px"/>
<div class="load_box" style="margin-top:-245px; width:280px; text-align:center;margin-left:-140px;">
	<div style="margin-left:auto;margin-right:auto;top:7px;text-align:center;font-size:19px;font-weight:bolder;">
			
	</div>
</div>

<div style="width:91%; margin-left:auto;margin-right:auto;">
	<div style="width:100%; text-align:center;margin-top:2px;">
		<form name="fbk" id="fbk" action="loginu_check.php?act=login&type=user" method="post" >
				<table style="margin-left:auto;margin-right:auto;background-color:rgba(0,0,0,0.85);opacity: 0.78;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-radius:6px;">
					<tr >
						<td style="color:#FC0044; font-size:15px; font-weight:bolder;" colspan="2"  height="40px">登录-卡玫尔</td>
					</tr>
					<tr >
						<td style="color:#fff; padding-left:15px;"  height="40px">手机号码:</td>
						<td style="color:#f0f; padding-right:15px;" align="left">
							<input placeholder="请输入正确的手机号码" name="phone" id="phone" value="" type="text"/>
						</td>
					</tr>
					<tr>
						<td style="color:#FD7297; font-weight:bolder;" colspan="2"  height="40px">
							<input type="hidden" name="s" value="<?=$s?>" />
							<input type="hidden" name="openid" value="<?=$openid?>" />
							<input type="submit" style="font-size:14px;font-weight:bolder; background-color:#FC0044;border-color:#BD2F55; width:90%;height:32px;" value="登录领取红包" >
						</td>
					</tr>
					<tr>
						<td style="color:#FFD300; font-size:10px;" colspan="2"  height="40px">该活动的最终解释权归卡玫尔所有</td>
					</tr>
<!--					<tr>-->
<!--						<td>-->
<!--							<a style="text-align:left;color:#fff;" href="javascript:history.go(-1)">←返回上一页</a>-->
<!--						</td>-->
<!--					</tr>-->
				</table>
		</form>
	</div>
</div>
<div class="load_box" style="margin-top:15px;height:120px; position:relative;">
	<!--<div class="liwuso_logo"></div>-->
</div>
<footer id="footer" class="index_footer" style="position:relative;">
	<div class="copy">
		<div style="margin-left:-90px">
			<img src="../images/mom.jpg"  width="100" height="100" /><span style="float:left;position:absolute;width:100px;font-size:14px;height:50px;text-align:left;margin-top:0px;">#长按关注#或者打开微信客户端搜索微信公众号<span style="color:red;">卡玫尔</span>进行关注了解更多</span><br>
		</div>
		<span style="color:#000">&copy;2016 卡玫尔 All Rights Reserved.</span>
	</div>
</footer>
<script type="text/javascript">
$(function()
{
    $('#formbackground').height($(window).height());
    $('#formbackground').width($(window).width());
    $('#fbk').submit(function(){
    	 var phone=$('#phone').val();
		if (!phone)
		{
			alert('请输入你的电话或者手机号码');return false;
		}
		else
		{
			if (!istell(phone) && !vailPhone(phone))
			{ 
				alert('请输入正确的电话或者手机号码');return false;
			}
		}
    });
});
function istell(str)
{
	var result=str.match(/\d{3}-\d{8}|\d{4}-\d{7}/);
	if(result==null) return false;
	return true;
}
function vailPhone(str){
    var phone = str;//jQuery("#phone").val();
    var flag = false;
    var message = "";
    var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;       
    if(phone == ''){
      message = "手机号码不能为空！";
    }else if(phone.length !=11){
      message = "请输入有效的手机号码！";
    }else if(!myreg.test(phone)){
      message = "请输入有效的手机号码！";
    }else if(checkPhoneIsExist()){
      message = "该手机号码已经被绑定！";
    }else{
        flag = true;
    }
    if(!flag){
   //提示错误效果
      //jQuery("#phoneDiv").removeClass().addClass("ui-form-item has-error");
      //jQuery("#phoneP").html("");
      //jQuery("#phoneP").html("<i class=\"icon-error ui-margin-right10\"> <\/i>"+message);
      //jQuery("#phone").focus();
    }else{
         //提示正确效果
      //jQuery("#phoneDiv").removeClass().addClass("ui-form-item has-success");
      //jQuery("#phoneP").html("");
      //jQuery("#phoneP").html("<i class=\"icon-success ui-margin-right10\"> <\/i>该手机号码可用");
    }
    return flag;
  }

</script>
</body>
</html>